package com.caoheng.entity;

import java.util.Date;
import java.util.UUID;

public class MerchantInfo {
    /**
     * 商户ID
     *
     * @mbggenerated
    */
    private String id;

    /**
     * 名称
     *
     * @mbggenerated
    */
    private String name;

    /**
     * 类型
     *
     * @mbggenerated
    */
    private String type;

    /**
     * 请求私钥
     *
     * @mbggenerated
    */
    private String requestKey;

    /**
     * 响应私钥
     *
     * @mbggenerated
    */
    private String responseKey;

    /**
     * 商户状态,0:停止使用,1:使用中
     *
     * @mbggenerated
    */
    private Byte state;

    /**
     * 创建时间
     *
     * @mbggenerated
    */
    private Date createTime;

    /**
     * 更新时间
     *
     * @mbggenerated
    */
    private Date updateTime;

    public static class Builder{
        private MerchantInfo merchantInfo;

        public Builder(){
            merchantInfo = new MerchantInfo();
        }

        public Builder(MerchantInfo merchantInfo){
            this.merchantInfo = merchantInfo != null ? merchantInfo : new MerchantInfo();
        }

        public Builder generateId(){
            this.merchantInfo.id = "SH-" + UUID.randomUUID().toString();
            return this;
        }

        public Builder name(String name){
            this.merchantInfo.name = name;
            return this;
        }

        public Builder type(String type){
            this.merchantInfo.type = type;
            return this;
        }

        public Builder state(byte state){
            this.merchantInfo.state = state;
            return this;
        }

        public Builder requestKey(String requestKey){
            this.merchantInfo.requestKey = requestKey;
            return this;
        }

        public Builder responseKey(String responseKey){
            this.merchantInfo.responseKey = responseKey;
            return this;
        }

        public MerchantInfo build(){
            return this.merchantInfo;
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRequestKey() {
        return requestKey;
    }

    public void setRequestKey(String requestKey) {
        this.requestKey = requestKey;
    }

    public String getResponseKey() {
        return responseKey;
    }

    public void setResponseKey(String responseKey) {
        this.responseKey = responseKey;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}